package com.源码分析;

import java.time.Duration;

import reactor.core.publisher.Flux;

public class SampleDemo {

	// 对于高吞吐量的场景下，通过采样技术处理一小部分事件是有意义的
	public static void main(String[] args) throws InterruptedException {
		Flux.range(1, 100)
			.delayElements(Duration.ofMillis(1))
			.sample(Duration.ofMillis(20))
			.subscribe(System.out::println);
		Thread.sleep(1000);
	}

}
